'use server'
import { logger } from "@/logger"
import { revalidatePath } from "next/cache";


export const addUser=async(prevState: any, formData: FormData)=>{


    logger.debug("cccccc")
    logger.debug(formData.get("name"))
    try {
            return revalidatePath('/')
        
    } catch (error) {
        return {name:"cc",age:0,erorr:"error msg"}
    }
    
    
}

export async function create(formData:FormData) {
    console.log(formData)
    
}

export async function createTodo(prevState: any, formData: FormData) {
    try {
    console.log(formData)
      return revalidatePath('/')
    } catch (e) {
      return { message: 'Failed to create' }
    }
  }